Skip to content

Conversation

winfriedgerlach
Copy link
Contributor

fixed lots of small but minor issues, hope you find this helpful!

@@ -124,7 +124,6 @@ local.properties
.factorypath
.project
.settings
.springBeans
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate of line 121

@robogary
Copy link

This Pull Request has failed the formatting check

Please run mvn spotless:apply or mvn clean install -DskipTests to fix the formatting issues.

You can automate this auto-formatting process to execute on the git pre-push hook, by installing pre-commit and then calling pre-commit install --hook-type pre-push. This will cause formatting to run automatically whenever you push.

@jkiddo
Copy link
Collaborator

jkiddo commented Jul 10, 2025

@winfriedgerlach - please run mvn spotless:apply to fix the formatting violations.

@jkiddo
Copy link
Collaborator

jkiddo commented Jul 10, 2025

Besides that, LGTM

@winfriedgerlach
Copy link
Contributor Author

winfriedgerlach commented Jul 11, 2025

hey @jkiddo , sorry, fixed now! I ran mvn spotless:apply and pushed the changes

@robogary
Copy link

Formatting check succeeded!

@jkiddo
Copy link
Collaborator

jkiddo commented Aug 1, 2025

Looks good to me - I'd like a second set of 👀 on it as well

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR focuses on cleaning up code quality issues across the codebase by standardizing syntax, fixing spelling errors, and applying modern Java patterns. The changes improve maintainability and consistency without altering functionality.

  • Updated variable declarations from var to let in JavaScript and deprecated Java patterns to modern alternatives
  • Corrected numerous spelling and grammatical errors in comments, documentation, and configuration files
  • Applied modern Java language features like pattern matching with instanceof and text blocks

Reviewed Changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/test/smoketest/plain_server.http Updated variable declarations from var to let
src/test/smoketest/SMOKE_TEST.md Fixed spelling errors in documentation
src/test/resources/application.yaml Corrected comment syntax and spelling errors
src/test/java/some/custom/pkg1/CustomInterceptorPojo.java Applied pattern matching with instanceof
src/test/java/some/custom/pkg1/CustomInterceptorBean.java Applied pattern matching with instanceof
src/test/java/ca/uhn/fhir/jpa/starter/SocketImplementation.java Removed printStackTrace call and improved logging
src/test/java/ca/uhn/fhir/jpa/starter/ParallelUpdatesVersionConflictTest.java Modernized lambda expressions and removed unused imports
src/test/java/ca/uhn/fhir/jpa/starter/MeasureEvaluationConfig.java Removed unused imports
src/test/java/ca/uhn/fhir/jpa/starter/IServerSupport.java Replaced deprecated Charsets with StandardCharsets
src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4IT.java Replaced string concatenation with text blocks and improved assertions
src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerR4BIT.java Replaced string concatenation with text blocks
src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDstu3IT.java Removed unnecessary blank lines
src/test/java/ca/uhn/fhir/jpa/starter/ExampleServerDbpmR5IT.java Changed class visibility modifier
src/test/java/ca/uhn/fhir/jpa/starter/ElasticsearchLastNR4IT.java Removed unused imports and changed class visibility
src/test/java/ca/uhn/fhir/jpa/starter/CdsHooksServletIT.java Replaced string concatenation with text blocks and fixed spelling
src/main/webapp/WEB-INF/templates/about.html Updated variable declarations and fixed punctuation
src/main/resources/cds.application.yaml Fixed spelling errors and comment syntax
src/main/resources/application.yaml Fixed spelling errors and comment syntax
src/main/java/ca/uhn/fhir/jpa/starter/util/EnvironmentHelper.java Applied pattern matching with instanceof
src/main/java/ca/uhn/fhir/jpa/starter/cr/PostInitProviderRegisterer.java Made inner class static
src/main/java/ca/uhn/fhir/jpa/starter/common/validation/RepositoryValidationInterceptorFactoryR5.java Fixed variable naming consistency
src/main/java/ca/uhn/fhir/jpa/starter/common/validation/RepositoryValidationInterceptorFactoryR4B.java Fixed variable naming consistency
src/main/java/ca/uhn/fhir/jpa/starter/common/validation/RepositoryValidationInterceptorFactoryR4.java Fixed variable naming consistency
src/main/java/ca/uhn/fhir/jpa/starter/common/StarterJpaConfig.java Improved logging and simplified Optional usage
src/main/java/ca/uhn/fhir/jpa/starter/common/FhirServerConfigCommon.java Modernized logging with parameterized messages
src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/ModuleConfigurationPrefetchSvc.java Simplified collection size check
src/main/java/ca/uhn/fhir/jpa/starter/cdshooks/CdsHooksServlet.java Added @serial annotation
src/main/java/ca/uhn/fhir/jpa/starter/Application.java Fixed spelling in comment
pom.xml Fixed comment punctuation
charts/hapi-fhir-jpaserver/README.md.gotmpl Fixed spelling error
charts/hapi-fhir-jpaserver/README.md Fixed table formatting and spelling error
README.md Fixed spelling errors throughout documentation

@@ -31,7 +31,7 @@ spring:
allow-bean-definition-overriding: true
flyway:
enabled: false
check-location: false
fail-on-missing-locations: false
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The property name change from check-location to fail-on-missing-locations appears to be changing the Spring Flyway configuration property. Verify that this property name is correct for the version of Spring Boot being used, as this could cause configuration to be ignored.

Suggested change
fail-on-missing-locations: false
check-location: false

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIU this is the non-deprecated replacement of "check-location"

Comment on lines 255 to 260
# or will be instantiated via reflection using a no-arg contructor; then registered with the server
#custom-interceptor-classes:

# comma-separated list of fully qualified provider classes.
# classes listed here will be fetched from the Spring context when combined with 'custom-bean-packages',
# or will be instantiated via reflection using an no-arg contructor; then registered with the server
# or will be instantiated via reflection using a no-arg contructor; then registered with the server
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word 'contructor' should be spelled 'constructor'.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

#custom-interceptor-classes:

# comma-separated list of fully qualified provider classes.
# classes listed here will be fetched from the Spring context when combined with 'custom-bean-packages',
# or will be instantiated via reflection using an no-arg contructor; then registered with the server
# or will be instantiated via reflection using a no-arg contructor; then registered with the server
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word 'contructor' should be spelled 'constructor'.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -269,12 +269,12 @@ hapi:

# comma-separated list of fully qualified interceptor classes.
# classes listed here will be fetched from the Spring context when combined with 'custom-bean-packages',
# or will be instantiated via reflection using an no-arg contructor; then registered with the server
# or will be instantiated via reflection using a no-arg contructor; then registered with the server
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word 'contructor' should be spelled 'constructor'.

Suggested change
# or will be instantiated via reflection using a no-arg contructor; then registered with the server
# or will be instantiated via reflection using a no-arg constructor; then registered with the server

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

#custom-interceptor-classes:

# comma-separated list of fully qualified provider classes.
# classes listed here will be fetched from the Spring context when combined with 'custom-bean-packages',
# or will be instantiated via reflection using an no-arg contructor; then registered with the server
# or will be instantiated via reflection using a no-arg contructor; then registered with the server
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word 'contructor' should be spelled 'constructor'.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@winfriedgerlach
Copy link
Contributor Author

@jkiddo @patrick-werner fixed spelling mistakes found by CoPilot

@robogary
Copy link

Formatting check succeeded!

@jkiddo
Copy link
Collaborator

jkiddo commented Aug 16, 2025

@winfriedgerlach
Copy link
Contributor Author

@winfriedgerlach did you check up on the error that is now present? https://github.com/hapifhir/hapi-fhir-jpaserver-starter/actions/runs/16826070940/job/47792357339?pr=840#step:4:4203

@jkiddo Oops, that's really weird. I could reproduce the issue locally and just reverted my change for now.

@robogary
Copy link

Formatting check succeeded!

@jkiddo
Copy link
Collaborator

jkiddo commented Aug 18, 2025

@winfriedgerlach one linting error left and we can merge this

@winfriedgerlach
Copy link
Contributor Author

@jkiddo wow, the linter requires unreadable table formatting? :-D
I reverted my change, hope everything is fine now

@robogary
Copy link

Formatting check succeeded!

@jkiddo
Copy link
Collaborator

jkiddo commented Aug 19, 2025

@chgl you good with the linting errors in the charts readme?

@winfriedgerlach
Copy link
Contributor Author

hmm, same version 0.20.0 is on master...

@chgl
Copy link
Contributor

chgl commented Aug 19, 2025

hmm, same version 0.20.0 is on master...

If something in the charts/* folder changes, the version of the chart.yaml also needs to be bumped. Even if it's just cosmetics in the readme. So you can change https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/charts/hapi-fhir-jpaserver/Chart.yaml#L17 to 0.20.1 and it should work. (Ideally also change the changelog annotations under https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/charts/hapi-fhir-jpaserver/Chart.yaml#L26, but not strictly necessary).

@winfriedgerlach
Copy link
Contributor Author

@chgl like this?

@robogary
Copy link

Formatting check succeeded!

@chgl
Copy link
Contributor

chgl commented Aug 19, 2025

@winfriedgerlach perfect, thank you!

Comment on lines 85 to 86
for (var service : services) {
myCdsServiceRegistry.unregisterService(service.getId(), "CR");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes a java.util.ConcurrentModificationException, either leave the index based iteration, or create a copy:

Suggested change
for (var service : services) {
myCdsServiceRegistry.unregisterService(service.getId(), "CR");
for (var service : new ArrayList<>(services)) {
myCdsServiceRegistry.unregisterService(service.getId(), "CR");
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my only issue was this error, but this change was reverted in the meantime

@jkiddo jkiddo merged commit 8224cae into hapifhir:master Aug 19, 2025
17 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants